import * as actionType from './constants.js';
import { trycar } from '../../../api/index'

export const InsertTrycarData = (data) => ({
    type: actionType.CHANGE_TRYCARDATA,
    data: data
})



export const getTrycarData = () => {
    return (dispatch) => {
        trycar()
            .then((res) => {
                console.log(res.data.data, "======");
                dispatch(InsertTrycarData(res.data.data))
            })
            .catch((e) => {
                console.log('出错了');
            })
    }
}